package com.ithuameng.admin.app.system.model.admin.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ithuameng.admin.app.system.model.Role;
import com.ithuameng.admin.enums.YesNo;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * UserRoleAuthVO
 *
 * @author ithuameng
 */
@Data
public class UserRoleAuthVo {

	private Long id;

	/**
	 * 角色权限
	 */
	private String roleKey;

	/**
	 * 角色名称
	 */
	private String name;

	/**
	 * 排序值
	 */
	private Integer seq;

	/**
	 * 角色描述
	 */
	private String remark;

	/**
	 * 状态
	 */
	private YesNo status;
	
	/**
	 * 创建时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private LocalDateTime createTime;

	/**
	 * 是否该权限
	 */
	private boolean flag;

	public boolean isAdmin() {
		return Role.ADMIN_ID == this.id;
	}
}
